package com.exposit.books.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.exposit.books.dao.AuthorDAO;
import com.exposit.books.dao.BookDAO;
import com.exposit.books.dao.GenreDAO;
import com.exposit.books.domain.Author;
import com.exposit.books.domain.Book;
import com.exposit.books.domain.Genre;

@Service
@Transactional
public class GenreServiceImpl implements GenreService {

	@Autowired
	private GenreDAO genreDAO;
	
	@Autowired
	private AuthorDAO authorDAO;
	
	
	@Override
	public Genre getGenreById(Long id) {
		return genreDAO.getById(id);
	}

	@Override
	public void updateGenre(Genre genre) {
		genreDAO.update(genre);
	}

	@Override
	public Author getAuthorById(Long id) {
		return authorDAO.getById(id);
	}

	

}
